package com.success.task.web.servlet.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;


@Controller
public class Welcome {
	
	@RequestMapping("/welcome.go")
	public ModelAndView welcome(HttpServletRequest request,HttpServletResponse response,  
            ModelMap modelMap) {  
		modelMap.put("test", "fsdafsadf");
        return new ModelAndView("welcome",modelMap);
    } 
	
	@RequestMapping("/welcomes.go")
	@ResponseBody
	public ModelAndView testJson (HttpServletRequest request,HttpServletResponse response,
			 ModelMap modelMap) {
		modelMap.put("test", "1111");
		return new ModelAndView("welcome",modelMap);
	}
}
